package com.hoshiicloud.user.entity.usercenter;

import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 用户资金流水表实体
 *
 * @author : yangcheng
 * @date : 2019/5/10 10:38
 * @mail : maiboyc@163.com
 **/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName(value = "member_funds")
public class MemberFund extends UserCenterBaseEntity implements Serializable {

    private static final long serialVersionUID = -3162620886409229308L;

    // 用户ID
    @NotNull(message = "用户主键ID不能为空")
    @ApiModelProperty(name = "userId", value = "用户主键ID", required = true, dataType = "java.lang.Long", example = "3171776001692664000")
    private Long userId;

    // 流水编号
    @NotNull(message = "流水编号不能为空")
    @ApiModelProperty(name = "flowno", value = "流水编号", required = true, dataType = "java.lang.String", example = "F0001")
    private String flowno;

    // 流水项目  充值
    @NotNull(message = "流水项目不能为空")
    @ApiModelProperty(name = "description", value = "流水项目", required = true, dataType = "java.lang.String", example = "充值")
    private String description;

    // 资金方向  d-入账  c-出账
    @NotNull(message = "资金方向不能为空")
    @ApiModelProperty(name = "dc", value = "资金方向", required = true, dataType = "java.lang.String", example = "d")
    private String dc;

    // 交易金额
    @NotNull(message = "交易金额不能为空")
    @ApiModelProperty(name = "amount", value = "交易金额", required = true, dataType = "java.math.BigDecimal", example = "2000.00")
    private BigDecimal amount;

    // 当前余额
    @NotNull(message = "当前余额不能为空")
    @ApiModelProperty(name = "balance", value = "当前余额", required = true, dataType = "java.math.BigDecimal", example = "2100.00")
    private BigDecimal balance;

    // 状态 0-作废 1-有限
    @NotNull(message = "状态不能为空")
    @ApiModelProperty(name = "status", value = "状态", required = true, dataType = "java.lang.Integer", example = "1")
    private Integer status;

    // 关联订单号
    @NotNull(message = "关联订单号不能为空")
    @ApiModelProperty(name = "reforderno", value = "关联订单号", required = true, dataType = "java.lang.String", example = "B10001")
    private String reforderno;

    // 第三方交易流水号
    @NotNull(message = "第三方交易流水号不能为空")
    @ApiModelProperty(name = "reftxno", value = "第三方交易流水号", required = true, dataType = "java.lang.String", example = "DS0001")
    private String reftxno;

    // 来源（1-充值 2-消费 3-分润 4-退款 5-转账 6-罚款 7-奖励 8-其他）
    @NotNull(message = "来源不能为空")
    @ApiModelProperty(name = "source", value = "来源", required = true, dataType = "java.lang.Integer", example = "1")
    private Integer source;

    // 备注
    @NotNull(message = "备注不能为空")
    @ApiModelProperty(name = "remark", value = "备注", dataType = "java.lang.Long", example = "备注信息")
    private String remark;

}